<?php
$TaskId = $_GET['id']??'';
$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");
$sql = "delete FROM Task where TaskId='{$TaskId}'";
$result=$db->exec($sql);
if ($result){
    echo '删除成功<a href="list.php">返回主界面</a>';
}else{
    echo'删除成功';
}